package test.course.pages {
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.events.MouseEvent;
	
	import test.course.components.TextButton;
	
	public class NavigationButtons extends Sprite {
		private var _nextButton:TextButton;
		private var _prevButton:TextButton;

		public function NavigationButtons() {
			_prevButton=new TextButton("<");
			_prevButton.x=10;
			_prevButton.y=10;
			_prevButton.addEventListener(MouseEvent.CLICK,onPrevButtonClick);
			addChild(_prevButton);

			_nextButton=new TextButton(">");
			_nextButton.x=35;
			_nextButton.y=10;
			_nextButton.addEventListener(MouseEvent.CLICK,onNextButtonClick);
			addChild(_nextButton);
		}
		
		protected function onNextButtonClick(event:MouseEvent):void {
			dispatchEvent(new Event("next"));
		}
		
		protected function onPrevButtonClick(event:MouseEvent):void
		{
			dispatchEvent(new Event("prev"));
		}
	}
}